public class DuoTaiDemo09 {
    public static void main(String[] args) {

        play(new King());
        play(new FlyCar());
    }

    public static void play(Game game) {
        game.play();
    }
}


class Game {
    private String name;

    public Game() {
    }

    public Game(String name) {
        this.name = name;
    }

    public void play() {
        System.out.println("玩");
    }
}

class FlyCar extends Game {
    @Override
    public void play() {
        System.out.println("竞速类游戏");
    }
}

class King extends Game {
    @Override
    public void play() {
        System.out.println("竞技类游戏");
    }
}